# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Analytics.V3.Model.CustomDataSource do
  @moduledoc """
  JSON template for an Analytics custom data source.

  ## Attributes

  *   `accountId` (*type:* `String.t`, *default:* `nil`) - Account ID to which this custom data source belongs.
  *   `childLink` (*type:* `GoogleApi.Analytics.V3.Model.CustomDataSourceChildLink.t`, *default:* `nil`) - 
  *   `created` (*type:* `DateTime.t`, *default:* `nil`) - Time this custom data source was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description of custom data source.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Custom data source ID.
  *   `importBehavior` (*type:* `String.t`, *default:* `nil`) - 
  *   `kind` (*type:* `String.t`, *default:* `analytics#customDataSource`) - Resource type for Analytics custom data source.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of this custom data source.
  *   `parentLink` (*type:* `GoogleApi.Analytics.V3.Model.CustomDataSourceParentLink.t`, *default:* `nil`) - Parent link for this custom data source. Points to the web property to which this custom data source belongs.
  *   `profilesLinked` (*type:* `list(String.t)`, *default:* `nil`) - IDs of views (profiles) linked to the custom data source.
  *   `schema` (*type:* `list(String.t)`, *default:* `nil`) - Collection of schema headers of the custom data source.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - Link for this Analytics custom data source.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Type of the custom data source.
  *   `updated` (*type:* `DateTime.t`, *default:* `nil`) - Time this custom data source was last modified.
  *   `uploadType` (*type:* `String.t`, *default:* `nil`) - Upload type of the custom data source.
  *   `webPropertyId` (*type:* `String.t`, *default:* `nil`) - Web property ID of the form UA-XXXXX-YY to which this custom data source belongs.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountId => String.t() | nil,
          :childLink => GoogleApi.Analytics.V3.Model.CustomDataSourceChildLink.t() | nil,
          :created => DateTime.t() | nil,
          :description => String.t() | nil,
          :id => String.t() | nil,
          :importBehavior => String.t() | nil,
          :kind => String.t() | nil,
          :name => String.t() | nil,
          :parentLink => GoogleApi.Analytics.V3.Model.CustomDataSourceParentLink.t() | nil,
          :profilesLinked => list(String.t()) | nil,
          :schema => list(String.t()) | nil,
          :selfLink => String.t() | nil,
          :type => String.t() | nil,
          :updated => DateTime.t() | nil,
          :uploadType => String.t() | nil,
          :webPropertyId => String.t() | nil
        }

  field(:accountId)
  field(:childLink, as: GoogleApi.Analytics.V3.Model.CustomDataSourceChildLink)
  field(:created, as: DateTime)
  field(:description)
  field(:id)
  field(:importBehavior)
  field(:kind)
  field(:name)
  field(:parentLink, as: GoogleApi.Analytics.V3.Model.CustomDataSourceParentLink)
  field(:profilesLinked, type: :list)
  field(:schema, type: :list)
  field(:selfLink)
  field(:type)
  field(:updated, as: DateTime)
  field(:uploadType)
  field(:webPropertyId)
end

defimpl Poison.Decoder, for: GoogleApi.Analytics.V3.Model.CustomDataSource do
  def decode(value, options) do
    GoogleApi.Analytics.V3.Model.CustomDataSource.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Analytics.V3.Model.CustomDataSource do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
